unit uMore; 

{$mode objfpc}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, StdCtrls, TDIPageControl;

type

  { TfrmMore }

  TfrmMore = class(TForm)
    lbTabs: TListBox;
    pnlForm: TPanel;
    procedure lbTabsDblClick(Sender: TObject);
  private
    { private declarations }
    pcTabs: TTDIPageControl;
    procedure LoadPages;
  public
    { public declarations }
    class procedure ListTabs(AOwner: TTDIPageControl; ACaption: TCaption);
  end; 

var
  frmMore: TfrmMore;

implementation

{$R *.lfm}

{ TfrmMore }

procedure TfrmMore.lbTabsDblClick(Sender: TObject);
begin
  pcTabs.ActivePage := pcTabs.Pages[lbTabs.ItemIndex];
  Close;
end;

procedure TfrmMore.LoadPages;
var
  i: Cardinal;
begin
  lbTabs.Items.Clear;

  for i := 0 to Pred(pcTabs.PageCount) do
    lbTabs.Items.Add(pcTabs.Pages[i].Caption);
end;

class procedure TfrmMore.ListTabs(AOwner: TTDIPageControl; ACaption: TCaption);
begin
  frmMore := TfrmMore.Create(nil);
  frmMore.Caption := ACaption;
  frmMore.pcTabs := AOwner;
  frmMore.LoadPages;
  frmMore.ShowModal;
  FreeAndNil(frmMore);
end;

end.

